package com.netease.financial.exception;

import android.content.Context;

import com.netease.financial.data.exception.AppUpdateInfoNotFoundException;
import com.netease.financial.data.exception.NetworkConnectionException;

/**
 * Factory used to tryCreate error messages from an Exception as a condition.
 */
public class ErrorMessageFactory {

    private ErrorMessageFactory() {
        //empty
    }

    /**
     * Creates a String representing an error message.
     *
     * @param context Context needed to retrieve string resources.
     * @param exception An exception used as a condition to retrieve the correct error message.
     * @return {@link String} an error message.
     */
    public static String create(Context context, Exception exception) {
//        String message = context.get(R.string.exception_message_generic);

        if (exception instanceof NetworkConnectionException) {
//            message = context.getString(R.string.exception_message_no_connection);
        } else if (exception instanceof AppUpdateInfoNotFoundException) {
//            message = context.getString(R.string.exception_message_app_update_info_not_found);
        }

        // TODO: need modify
        String message = "temp";
        return message;
    }
}
